import loading from './loading.vue'
import Vue from 'vue'

var loadingInstance = function () {
	const Instance = new Vue({
	    render (h) {
	        return h(loading);
	    }
	});

	const component = Instance.$mount();
	document.body.appendChild(component.$el);
	const notification = Instance.$children[0];

	// 显示加载动画
	function show(info){
		notification.info = info;
		notification.visible = true;
	}

	// 隐藏加载动画
	function  hide(){
		notification.visible = false;
	}

	return {
		show: show,
		hide: hide
	}
};

export default loadingInstance()